import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home/Home'
import Menu from '@/components/Menu/Menu'
import Order from '@/components/Order/Order'
import Detail from '@/components/OrderDetail/OrderDetail'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      meta: {
        keepAlive: true // 需要缓存
      }
    },
    {
      path: '/menu',
      name: 'Menu',
      component: Menu,
      meta: {
        keepAlive: true // 需要缓存
      }
    },
    {
      path: '/order',
      name: 'Order',
      component: Order,
      meta: {
        keepAlive: false // 不需要缓存
      }
    },
    {
      path: '/detail',
      name: 'Detail',
      component: Detail,
      meta: {
        keepAlive: false // 不需要缓存
      }
    }
  ]
})
